package com.zte.user.control;

import com.zte.user.model.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/page")
public class Action {
    @RequestMapping("/login")
    public String login(){
        return "login";
    }
    @RequestMapping("/logout")
    public String  logout(HttpSession session){
        session.removeAttribute("userSession");
        return "login";
    }
    @RequestMapping("/frame")
    public String frame(){
        return "frame";
    }
    @RequestMapping("/update")
    public String update(){
        return "index_修改用户密码";
    }
    @RequestMapping("/register")
    public String register(){
        return "register";
    }
    @RequestMapping("/student")
    public String student(){
        return "index_学生个人信息";
    }
    @RequestMapping("/addcourse")
    public String addcourse(){ return "index_添加课程信息"; }
    @RequestMapping("/updatestudent")
    public String updatestudent(Model model, HttpServletRequest request){
        String stuid = request.getParameter("stuid");
        model.addAttribute("stuid",stuid);
        return "index_修改学生信息";
    }@RequestMapping("/updatecourse")
    public String updatecourse(Model model, HttpServletRequest request){
        String courseid = request.getParameter("courseid");
        model.addAttribute("courseid",courseid);
        return "index_修改课程信息";
    }
    @RequestMapping("/updateteacher")
    public String updateteacher(Model model, HttpServletRequest request){
        String tid = request.getParameter("tid");
        model.addAttribute("tid",tid);
        return "index_修改教师信息";
    }
    @RequestMapping("/students")
    public String students(){
        return "index_学生信息";
    }
    @RequestMapping("/teaper")
    public String teaper(){
        return "index_教师个人信息";
    }
    @RequestMapping("/teachers")
    public String teachers(){
        return "index_教师信息";
    }
    @RequestMapping("/attclazz")
    public String attclazz(){
        return "index_查看班级考勤";
    }
    @RequestMapping("/att")
    public String att(){
        return "index_点名考勤";
    }
    @RequestMapping("/leave")
    public String leave(){
        return "index_请假审核";
    }
    @RequestMapping("/lookabsence")
    public String lookabsence(){
        return "index_查看已审核请假申请";
    }
    @RequestMapping("/absence")
    public String absence(){
        return "index_请假申请";
    }
    @RequestMapping("/course")
    public String course(){
        return "index_课程信息";
    }


}
